<!DOCTYPE html>
<html>
<head>
    <title>继承自角色的权限</title>
    <#include "/common/import.ftl" >
    <script>
        var userId = "${userId!''}";
        $(function () {
            $('#roleAct').datagrid({
                title: '',
                url: '${ctx}/uct/core/user-right-role!data.action?userId=' + userId,
                loadMsg: '数据载入中，请稍后……',
                fitColumns: true,
                nowrap: true,
                rownumbers: true,
                striped: true,
                collapsible: false,
                fitColumns: true,
                singleSelect: true,
                rownumbers: true,
                remoteSort: false,
                pagination: true,
                pageList: [10, 15, 20, 30, 50],
                idField: 'actId',
                columns: [[
                    {
                        field: 'actCname', title: '权限名称', width: 100, sortable: true,
                        sorter: function (a, b) {
                            return (a > b ? 1 : -1);
                        },
                        formatter: function (value) {
                            return '<span style="color:red">' + value + '</span>';
                        }
                    },
                    {
                        field: 'fullEname', title: '权限英文全称', width: 100, sortable: true,
                        sorter: function (a, b) {
                            return (a > b ? 1 : -1);
                        }
                    },

                    {
                        field: 'fullCname', title: '权限中文全称', width: 100, sortable: true,
                        sorter: function (a, b) {
                            return (a > b ? 1 : -1);
                        }
                    }
                ]]
            });


            var p = $('#roleAct').datagrid('getPager');
            if (p) {
                $(p).pagination({
                    onBeforeRefresh: function () {
                        //alert('before refresh');
                    }
                });
            }

        });


    </script>

</head>

<body>
<table id="roleAct"></table>

</body>
</html>